<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>注册页面</title>
		<style>
		body{
		background:url(imag/bjtp.jpg);
		}
		.zc{
		width:300px;
		height:500px;
		background:url(imag/zcbj1.jpg);
		margin:100px auto;
		border:2px solid violet;
       padding-left: 20px;
        line-height: 30px;
		}
        .zc:hover{
            box-shadow:10px 10px 50px yellow;
        }
        .zc h2{
            text-align: center;
        }
        #qr{
            background-color:red;
            border-radius: 20px;
        }
        #qr:hover{
            background-color: chartreuse;
        }
        </style>
        <script>
            function check(){
                if(mm.value!=mmqr.value){
                    alert("密码不一致");
                    mm.style.background="red";
                    return false;
                }
                localStorage.yhm=yhm.value;
                localStorage.mm=mm.value;
                if(xb1.checked){
                localStorage.xb=xb1.value;
                }
                else{
                    localStorage.xb=xb2.value;
                }
                var s="";
                var obj=document.getElementsByName("xqah");
                for(var i=0;i<obj.length;i++){
                    if(obj[i].checked)
                    s+=obj[i].value+" ";
        }
              localStorage.xqah=s;
              localStorage.dh=dh.value;
              localStorage.yx=yx.value;  
              alert("注册成功");
              return true;
            }
            function xy(){
            
             if(tybxy.checked){
                qr.disabled=false;
             }else{
                 qr.disabled=true;
             }
            }
        </script>
    </head>
    <body>
        <div class=zc>
		<h2>用户注册</h2>
            <form  onsubmit="return check()" action="用户中心.html">
            用户名:<input type="text" id=yhm required placeholder="请输入用户名"><br>
            密    码:<input type="password"  id=mm  required ><br>
            密码确认:<input type="password" id=mmqr required><br>
            性    别:<input type="radio"  value="男" name=xb id=xb1>男
                    <input type="radio"  value="女" name=xb id=xb2> 女<br>
            兴趣爱好:<input type="checkbox" name=xqah value="音乐" checked>音乐
            <input type="checkbox" name=xqah value="游泳">游泳
            <input type="checkbox" name=xqah value="唱歌">唱歌
            <input type="checkbox" name=xqah value="滑板">滑板<br>
            电话:<input type="tel" id=dh><br>
            邮箱:<input type="email" id=yx><br>
            <input type="checkbox" id=tybxy checked onclick="xy()">同意本协议<br>
            <input type=submit value="确认" id=qr>
            <a href="用户登录.html">登录
			</form>
        </div>
    </body>
</html>